package com.mg.yygh.hosp.utils;

import com.mg.yygh.common.exception.YyghException;
import com.mg.yygh.common.helper.HttpRequestHelper;
import com.mg.yygh.common.result.ResultCodeEnum;
import com.mg.yygh.common.utils.MD5;
import com.mg.yygh.hosp.service.HospitalSetService;
import com.mg.yygh.model.hosp.HospitalSet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * @author M_Dragon
 * @date 2022/8/31/031 11:22
 */

// 数字签名验证工具类
@Component
public class SignVerify {

    @Autowired
    private static HospitalSetService setService;



    public static boolean SignKeyVerify(Map<String, Object> map){

        // 数字签名 判断 是否一致  switchMap 中sign 经过MD5加密 ，需要同样加密再做判断
        String key = (String) map.get("sign");
        String hoscode = (String) map.get("hoscode");
        System.out.println("=======hoscode====="+hoscode);
//        String signKey = sestService.getSignKeyByCode(hoscode);
        List<HospitalSet> list = setService.list();
        System.out.println("=======list======"+list);
//        String MdSignkey = MD5.encrypt(signKey);

        return true;
    }
}
